from pandas import read_csv
import matplotlib.pyplot as plt

mean_returns = read_csv("./temp_files/mean_returns.csv", index_col=0, skiprows=[0])
# print(mean_returns)
std_returns = read_csv("./temp_files/std_returns.csv", index_col=0, skiprows=[0])
# print(std_returns)
frontier_HC = read_csv("./frontier/frontier_HC.csv", index_col=1, skiprows=[0])
# a dataframe
print(frontier_HC)
frontier_HC_list = frontier_HC.values.tolist()
print(frontier_HC_list)
frontier_GB = read_csv("./frontier/frontier_GB.csv",index_col=1, skiprows=[0])
print(frontier_GB)
frontier_GB_list = frontier_GB.values.tolist()
print(frontier_GB_list)
frontier_MGB = read_csv("./frontier/frontier_MGB.csv",index_col=1, skiprows=[0])
print(frontier_MGB)
frontier_MGB_list = frontier_MGB.values.tolist()
print(frontier_MGB_list)

fig, ax = plt.subplots()
ax.plot(std_returns, mean_returns, '.')
ax.plot([x[1] for x in frontier_HC_list], [x[0] for x in frontier_HC_list], color="g", label="HC")
ax.plot([x[1] for x in frontier_GB_list], [x[0] for x in frontier_GB_list], color="b", label="GB")
ax.plot([x[1] for x in frontier_MGB_list], [x[0] for x in frontier_MGB_list], color="r", label="MGB")
ax.legend()
plt.xlabel('risk')
plt.ylabel('return')
plt.show()
